package com.study.demo03;

public class Client {

    public static void main(String[] args) {
        //真实角色
        Host host = new Host();

        //代理角色：需要生成一个
        ProxyInvocationHandler proxyInvocationHandler = new ProxyInvocationHandler();

        proxyInvocationHandler.setRent(host);

        //这里的proxy就是动态生成的
        Rent proxy = (Rent) proxyInvocationHandler.getProxy();

        proxy.rent();


    }
}
